// (c) 2007 Messaging Logic. All Rights Reserved.
package org.xi8ix.jms;

import javax.jms.*;
import javax.naming.Context;

/**
 * @author Iain Shigeoka
 */
public class JMSConnection implements Connection {

    private String clientID;
    private ExceptionListener exceptionListener;
    private boolean running = false;
    private Context context;

    public JMSConnection(Context context) {
        this.context = context;
    }

    public Session createSession(boolean b, int i) throws JMSException {
        return new JMSSession(context);
    }

    public String getClientID() throws JMSException {
        return clientID;
    }

    public void setClientID(String clientID) throws JMSException {
        this.clientID = clientID;
    }

    public ConnectionMetaData getMetaData() throws JMSException {
        return null;
    }

    public ExceptionListener getExceptionListener() throws JMSException {
        return exceptionListener;
    }

    public void setExceptionListener(ExceptionListener exceptionListener) throws JMSException {
        this.exceptionListener = exceptionListener;
    }

    public void start() throws JMSException {
        running = true;
    }

    public void stop() throws JMSException {
        running = false;
    }

    public void close() throws JMSException {
        stop();
    }

    public ConnectionConsumer createConnectionConsumer(Destination destination, String string, ServerSessionPool serverSessionPool, int i) throws JMSException {
        return null;
    }

    public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String string, String string1, ServerSessionPool serverSessionPool, int i) throws JMSException {
        return null;
    }
}
